package com.fh.shop.api.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000121649989";

	public static String seller_id = "2088621991109295";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCNUgS1UlGZasdAmSCB5EYszurMVZGvolu+G1kZoI7H/O5AXHKv4Sgt/dRBljL2HuJIrZiEL/3rwqyxT6FYSaWuIInXBCqiN+47/+V/PoUro6Nqem9ZaswHvmw+cn3K1enZDWtSOGisQwsTd29guMuZGBK17UZ9qCQXbFDSMaO9VoyxoY7u/XZ3zlRGVIMc2lAZ275Lawriwfof/CvimESVLiKzyjkzGcuWJH/RjiZYS6ZAIjo3Sq2bp9dV7AdbQSiWJIF6X+c+wTUQ69lzwCVf+UjDOQmB7NNusjJ5vh+JWBNd83wi+H8NeqoyVKULxdUVpUD2pjhA5w5ettI0TIADAgMBAAECggEAAbQZZm4lmanV2Qt/ftFXnzanUes+JFXasUH3Iv3yeqqr3I7AuyoFp/hFVL0QxDK/G40sJ3vEndDs7/47vaq1mpG915+vO+Fct9Bv3cbNKCeC0sfDC9rjtrwu5dnPdmB5vyoQPx9684ijW4q3Bv1zRtcpcpP3o5AhTz75Am+iv6eEydafQyEUkL/sCL05VkkI2votph0bL4KehyioR9QiIfOsIOg62Zu3vO/0R4pAXCaoehiQ7LYEvsUYHOaZxy2q0KdnCn1/xh+fpHbN64R26KQZkT4djHMho/80ZaALUsYrlAGvQBX+lam9T82c7PicbQzKLLskt/pjJrrPuVOocQKBgQDfAu8UjoUcDxs+gPSAN+sIvORUVU/01uLgWNgAHy8mm/N71FI+H4buGrvfgf3uNuY//ecG9Hh+9RqehU9208xAePZIUCWpX8J1upcMxk3aTjl/xGCJ0Ozf+sv4ngoDrFmwCCHwLVNWvQsfCrtYjgKJUECw5zegFA3slImPRIzsTwKBgQCiOZT08tR7hGjyjyzJX04uFVchR4WaDyzcR7q2TKyIPAv2Zs5BxZ4YPzwpOVsbe8zkZOQGINBqBTn6mUqvD7zZGoSFBw4Vz6LK+YIKynyGVh79DoC/q5g5uuqilOrj3IJ8jctOdtytSTOaNY6xZ+Cn6Urj0hVVtJdOy3wuzPOADQKBgH/bqML6ayqJJq+RM50HckNSOP544xyWzwCdL0nylw/lvZUzR+vCG5QL08bzOmkHJL9vjLMaGrN/R0G3YLXZ/HLCZ0FSYiVXd6AT2GJEl4If8ytjpY2eMRDBM4xY35j3iXw5TWvsMKm8PNIRTxQYZy/eyRgjmGq41Lrc9nkjbkBVAoGARtdUZ/8esO2qkrnZOfrHfjJNgTflbNhRo8QjEfa7pSZrpudQDMLKfhYnJG1qjr7qQ5aXSOHNgW7U2c1VIsuBkWEWG61wBjBNC8wXcLTp2hQDpkhOCuVZLWSlj+fuByFFTjTxYktfpMCBq0bWEDyni0vCK2iTboDVTlBn41wWvYUCgYBoKEvJUwNKP8cvtbFTsPVc/Hcz5fEizOtmvrHMuaB0wlruHrKnaajne+lSc/LkxzcF7JqxE+0evz2NprJjQDHeJCCmPyAcFj1u25UIfmSeW/3x01dcScFD4DfKZpbqL0kOiTcjaGKtsSRcmPnbf89F7XP2fNTbJEMwS+gbt+knng==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkW9vBFwbinDxiWtGtKzO0NLPisBEU0Znh7Ho1k0QgvBoTe8UlttZam+omxeRlW1KWTI2AMaJz/FvIYMCEL0hNmvCdfVzwIzd6YZbt10mebjafylVKF8BUcZv98wH8etytxnQ7zrbLC1c3Jq5EY080uEhvdWB0kL66XYnBassk6sMo/ZW3jY+baYX0xxL151wBOkVVLN0NiPgYFkutvzXF8qF+mlysgp1DAVKC/VMXAnBX2/YO9exfTCvFe7aKaNvZt7gXPvNuROLk6RG5wIOvB2yhdImGusuj0Y07OB5UuZg+dqOK055RblFe3lO+MqrhXQai63knTtn73IdCK+RrQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://g8x4z4.natappfree.cc/api/pay/aliNotify";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://g8x4z4.natappfree.cc/api/pay/aliReturn";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
//	public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

